#include "widget.h"
#include "ui_widget.h"
#include <QButtonGroup>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QButtonGroup* group1 = new QButtonGroup();
    QButtonGroup* group2 = new QButtonGroup();
    QButtonGroup* group3 = new QButtonGroup();

    group1->addButton(ui->radioButton);
    group1->addButton(ui->radioButton_2);
    group1->addButton(ui->radioButton_3);

    group2->addButton(ui->radioButton_4);
    group2->addButton(ui->radioButton_5);
    group2->addButton(ui->radioButton_6);

    group3->addButton(ui->radioButton_7);
    group3->addButton(ui->radioButton_8);
    group3->addButton(ui->radioButton_9);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_radioButton_clicked()
{
    QString str = "你选择的主食：" + ui->radioButton->text();
    ui->label->setText(str);
}

void Widget::on_radioButton_2_clicked()
{
    QString str = "你选择的主食："  + ui->radioButton_2->text();
    ui->label->setText(str);
}
void Widget::on_radioButton_3_clicked()
{
    QString str = "你选择的主食："  + ui->radioButton_3->text();
    ui->label->setText(str);
}

void Widget::on_radioButton_4_clicked()
{
    QString str = "你选择的小吃："  + ui->radioButton_4->text();
    ui->label_2->setText(str);
}
void Widget::on_radioButton_5_clicked()
{
    QString str = "你选择的小吃："  + ui->radioButton_5->text();
    ui->label_2->setText(str);
}
void Widget::on_radioButton_6_clicked()
{
    QString str = "你选择的小吃："  + ui->radioButton_6->text();
    ui->label_2->setText(str);
}

void Widget::on_radioButton_7_clicked()
{
    QString str = "你选择的饮料："  + ui->radioButton_7->text();
    ui->label_3->setText(str);
}
void Widget::on_radioButton_8_clicked()
{
    QString str = "你选择的饮料："  + ui->radioButton_8->text();
    ui->label_3->setText(str);
}
void Widget::on_radioButton_9_clicked()
{
    QString str = "你选择的饮料："  + ui->radioButton_9->text();
    ui->label_3->setText(str);
}


